<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>
</body>
<script src="https://unpkg.com/@vue/reactivity@3.0.5/dist/reactivity.global.js"></script>

<script>
    // console.log('VueReactivity==', VueReactivity)
    const { effect, ref } = VueReactivity

    function render (domString, container) {
        container.innerHTML = domString
    }

    const count = ref(1)

    effect(() => {
        render(`<h1>${count.value}</h1>`, document.getElementById('app'))
    })
    setTimeout(() => {
        count.value += 1
    }, 2000)

    // 利用响应式系统的能力，自动调用渲染器完成页面的渲染与更新。
    // 在上面这个渲染器的实现中，仅仅设置了innerHTML的内容
</script>
</html>